﻿//Copyright (C) <2013>  <jonathan cleeve norton> All Rights Reserved 
//Contact jon.norton@algoplus.co.uk website <http://www.algo-plus.co.uk/>
using FinPlusCompCore;
using FinPlusAssembler;
using FinPlusInterfaces;

namespace FinPlusCompAlgo
{
    public class AlgPlusLimits : FinPlusComponent 
    {
        [State(Test = true)]
        public override bool IsValid { get; set; }
        [State(Test = true)]
        public override string TestString { get { return Adapter.ToString(); } }

        //construct
        public AlgPlusLimits()
        {
            IsValid = true;
        }

        //common control interface

        public override void Dispose()
        {
            //TODO
        }

        public override void CmdExecute(IPod command)
        {
            try
            {
                CmdCapture(command);
            }
            catch (CmdExecuteException e)
            {
                IsValid = Level.Error.Log( Id, Config, e.Message, e);
            }
        }
    }
}
